17.10 AT^SPBG Display phonebook entries in alphabetical orderAT^SPBG sorts the entries of the current phonebook in alphabetical order by name (the first six characters matter). The sort order is described in Section 17.1, Sort Order for Phonebooks.
There are two ways to use AT^SPBG:
• If the optional parameter <RealLocReq> equals 0 or is omitted the sorted entries will be sequentially numbered. As these numbers are not identical with the location numbers stored in the various phonebooks AT^SPBG can be used for reading only. For example, it helps you find entries starting with matching characters. Do not use the serial numbers to dial out or modify entries.
• If parameter <RealLocReq>=1 is given by the write command, the response parameter <location> additionally appended to each entry indicates the actual location number. This number can be used for editing with AT+CPBW or dialing with ATD><mem><n>. The first index number of each entry is only the serial number of the sorted list.Before using the AT^SPBG write command it is recommended to query the number of records currently stored in the active phonebook (refer to test command parameter <used>). The test command also includes the parameters <nlength> and <tlength>. Note that if SIM storage is selected the length may not be available. If storage does not offer format information, the format list should be empty parenthesises.
<index1>(num)First index number in the sorted list where to start reading. The supported range is given in the test command response.
If <index 1> exceeds the upper bound <used>, "+CME ERROR: "invalid index" will be returned.
<index2>(num)Last index number in the sorted list where to stop reading. The supported range is given in the test command response.
If <index2> is not given via write command, only the entry located at <index1> will be displayed.
If both <index1> and <index2> are in the range indicated by the test command parameter <used>, the list of entries will be output and terminated with OK.
If <index2> exceeds the range indicated by the test command parameter <used>, the list of entries will be output but terminated with a "+CME ERROR: "invalid index".
Note: The maximum value of <index2> is 255, regardless of the phonebook type and its range indicated by the parameter <used>. If a value greater than 255 is used the query returns no phonebook records, and only "+CME ERROR: invalid index" is shown.
<RealLocReq>(num)Is a display of the "real" <location> of the entry required?Do not show an entry's "real" location number. Parameter <location> will not be displayed.Show the "real" location number as parameter <location> at the end of each entry.
<number>(str)
<type>(num)Type of address octet, which defines the used type of number (ton) and the numbering plan identification (npi).
Please consider that for types other than 129 or 145 dialing from phonebook with ATD><mem><n> is, depending on the network, not always possible (refer to GSM 04.08 subclause 10.5.4.7 for details). See also <type> of AT+CPBW.
Possible values are:Dialing string <number> includes international access code character '+'Dialing string <number> has been saved as ASCII string and includes non-digit characters other than "*", "#" or "+". Note that phonebook entries saved with this type cannot be dialed.Dialing string <number> is a command to control a Supplementary Service, i.e. "*", "#" codes are contained. Network support of this type is optional.
<text>(str)(+CSCS)Text assigned to the phone number. The maximum length for this parameter is given in test command response <tlength>.
<used>(num)
<location>(num)The location within phonebook memory at which the corresponding entry is located.
This location may be used for other commands (e.g. AT+CPBR or ATD><mem><n>)
<nlength>(num)Maximum length of phone number for "normal" locations. Depending on the storage, a limited number of locations with extended memory is available per phonebook. Please refer to AT command AT+CPBW for detail.
<tlength>(num)Maximum length of <text> assigned to the telephone number. The value indicated by the test command is given in octets. If the <text> string is given in GSM characters, each character corresponds to one octet. If the <text> string is given in UCS2, the maximum number of characters depends on the coding scheme used for the alpha field of the SIM according to GSM 11.11, Annex B [26]. In the worst case the number of UCS2 characters is at least one less than half the number of GSM characters.
• Users should be aware that when using this AT command quickly after SIM PIN authentication the SIM data may not yet be accessible, resulting in a short delay before the requested AT command response is returned. See Section 23.1, Restricted access to SIM data after SIM PIN authentication for further detail.
EXAMPLE 1
First run the AT^SPBG test command to find out the range of entries stored in the current phonebook. TA returns the range, where 33 is the number of entries stored in the current phonebook. Now, enter the write command. To obtain best results it is recommended to query the full range of entries. TA returns phonebook entries in alphabetical order. The numbers at the beginning of each line are not the memory locations in the phonebook, but only serial numbers assigned to the entries' positions in the alphabetical list.
EXAMPLE 2
First run the AT^SPBG test command to find out the range of entries stored in the current phonebook. TA returns the range, where 33 is the number of entries stored in the current phonebook. Now, enter the write command including parameter <RealLocReq>=1 to get the actual location numbers. The numbers at the end of each line are the memory locations in the phonebook and can be used for dialing or editing phonebook entries:
|